package elec315.chatroom.msg.chat;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import elec315.chatroom.msg.MsgId;
import elec315.chatroom.msg.ResMsg;
import elec315.chatroom.msg.ReturnCode;

public class ChatBroadcastResMsg implements ResMsg, Serializable {

	private static final long serialVersionUID = -5208301967970238273L;

	private static final MsgId msgId = MsgId.CHAT_RES_BROADCAST;

	private String reqByUserId;
	private Date msgTime;
	private ReturnCode returnCode;
	private String userId;
	private String message;

	public ChatBroadcastResMsg(String reqByUserId, Date msgTime, ReturnCode returnCode, String userId, String message) {
		super();
		this.reqByUserId = reqByUserId;
		this.msgTime = msgTime;
		this.returnCode = returnCode;
		this.userId = userId;
		this.message = message;
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see elec315.chatroom.msg.BaseMsg#getMsgId()
	 */
	public MsgId getMsgId() {
		return msgId;
	}

	public String getReqByUserId() {
		return reqByUserId;
	}

	public void setReqByUserId(String reqByUserId) {
		this.reqByUserId = reqByUserId;
	}

	public Date getMsgTime() {
		return msgTime;
	}

	public void setMsgTime(Date msgTime) {
		this.msgTime = msgTime;
	}

	public ReturnCode getReturnCode() {
		return returnCode;
	}

	public void setReturnCode(ReturnCode returnCode) {
		this.returnCode = returnCode;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		ToStringBuilder builder = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
		builder.append("msgId", msgId);
		builder.append("reqByUserId", reqByUserId);
		builder.append("msgTime", msgTime);
		builder.append("returnCode", returnCode);
		builder.append("userId", userId);
		builder.append("message", message);
		return builder.toString();
	}

}
